﻿function Trim(str)
{
	var i=0;
	var len=str.length;
	if(str=="") return str;

	j=len-1;
	flagbegin=true;
	flagend=true;

	while (flagbegin==true && i<len)
	{
		if(str.charAt(i)==" ")
		{
			i=i+1;
			flagbegin=true;
		}
		else
		{
			flagbegin=false;
		}
	}

	while (flagend==true && j>=0)
	{
		if(str.charAt(j)==" ")
		{
			j=j-1;
			flagend=true;
		}
		else
		{
			flagend=false;
		}
	}

	if(i>j) return "";

	trimStr=str.substring(i,j+1);
	return trimStr;
}

function confirm_delete(){
	if (confirm("确信删除?")){
		return true;
	}
	return false;
}


function confirm_lock(){
	if (confirm("确定锁定会员帐号?")){
		return true;
	}
	return false;
}


function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.Name != "chkAll")
		e.checked = form.chkAll.checked;
	}
}


function openwin(urls){
	window.open(urls,"","scrollbars=1,toolbar=0,status=no,location=0,resizable=0,height=450,width=500,titlebar=0");
	return false;
}